<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head>
		<th:block th:replace="tpl :: common_head()"></th:block>
		<title>轮播图管理</title>
	</head>
	<body th:with="entrance='/system/banner/index'">
		<th:block th:replace="tpl :: common_body(~{::.main-right})">
		<div class="main-right">
			<h1 class="main-right-h1">轮播图列表</h1>
			<ul class="main-right-tab">
				<li class="selected">列表</li>
				<li><a href="0">新增</a></li>
			</ul>
			<form method="GET" th:object="${query}">
				<div class="panel">
					<table class="table">
					    <thead>
					      <tr>
					        <th>操作</th>
					        <th>轮播图</th>
					        <th>排序号</th>
					      </tr> 
					    </thead>
					    <tbody>
							<tr th:each="obj : ${page.content}" th:object="${obj}">
								<td>
									<a th:href="*{id}">编辑</a>&nbsp;
									<a th:href="'javascript:deletes('+*{id}+');'">删除</a>
								</td>
								<td><img style="width:200px" th:src="*{@imageService.getImageBasePath()+cover}"></td>
								<td th:text="*{sort}"></td>
							</tr>
						</tbody>
					</table>
				</div>
				<div th:replace="tpl :: pagination(${page})"></div>
			</form>
		</div>
		</th:block>
		<script type="text/javascript">
		
			function updatePsw(id) {
				layer.confirm('确定重置密码吗？', {
					title : '提示'
				}, function(index) {
					window.location.href = "updatePsw?id="+id;
					layer.close(index);
				});
			}
			function deletes(id) {
				layer.confirm('确定删除?', {
					title : '提示',
					btn:['确定','取消']
				}, function(index) {
					window.location.href = "delete?id="+id;
					layer.load();
				});
			}
		</script>
	</body>
</html>